export interface Task {
  id: string
  title: string
  description?: string
  dueDate?: Date
  priority: 'P0' | 'P1' | 'P2' | 'P3'
  category: 'work' | 'personal' | 'learning' | 'health' | 'other'
  tags: string[]
  completed: boolean
  subtasks: SubTask[]
  notes?: string
  status: TaskStatus
  boardPosition: number
  isRecurring?: boolean
  parentRecurringId?: string
  createdAt: Date
  updatedAt: Date
}

export type TaskStatus = 'todo' | 'in_progress' | 'review' | 'done'

export interface KanbanColumn {
  id: string
  status: TaskStatus
  title: string
  color: string
  column_order: number
  is_visible: boolean
  taskCount: number
}

export interface KanbanData {
  columns: KanbanColumn[]
  tasks: Record<TaskStatus, Task[]>
}

export interface SubTask {
  id: string
  title: string
  completed: boolean
}

export interface AISuggestion {
  id: string
  type: string
  title: string
  content: string
  priority: 'high' | 'medium' | 'low'
  actions: AIAction[]
  taskId?: string
  reasoning?: string
  createdAt: string
}

export interface AIAction {
  label: string
  action: string
  primary?: boolean
}

export interface TaskSection {
  title: string
  tasks: Task[]
}

export interface SearchResult {
  tasks: Task[]
  suggestions: string[]
}

// 聊天消息类型
export interface ChatMessage {
  role: 'user' | 'assistant' | 'system'
  content: string
  messageId: string
  functionCall?: {
    name: string
    chineseName?: string
    arguments: any
  }
  functionResult?: {
    name: string
    result: any
    message?: string
  }
  functionError?: {
    name: string
    error: string
  }
}